Repository navigation
feat(launcher): the pet in the header reacts to what you type - #71
Merged
Merged
Conversation
It was a still picture in the corner of the box. It now breathes, leans toward the text when there is a row to run, tilts its head when there is not, taps along with each key, hops when a search finally finds something or a row is run, and dozes with a small z when the box is left empty for eight seconds. The sprite is not redrawn. cat-preview.js is shared with the site and a test keeps the two copies identical, so the finished picture is moved instead: breathing animates scale, a mood is a rotate pose, a one-off is translate. The three are separate properties, so they never fight, and all of it stays on the compositor. Which mood to show is a pure function in launcher-pet.js that sees only whether a row can be run, never its wording. It holds still under the OS reduced-motion setting and the app's own: the pose stays, every animation and transition goes. From review: Escape and running a row count as activity, so a long sentence followed by Escape does not doze at once. The breathing speed is a variable, since one animation-duration on the doze rule outranked the hop and stretched it to six seconds. A reaction ends with its own animation and not with the next re-render, which the one-second timer countdown would otherwise cut short. Reopening starts from rest.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
CI for 919ddf7: all jobs passed
Tests: 524 passed, 0 failed, 0 skipped, 524 total. This comment updates itself on every push. Full run. |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
The pet in the corner of the launcher was a still picture. Now it reacts.
How
cat-preview.jsis shared with the site andtests/site-sync.test.jskeeps the copies identical, so the finished picture is moved instead. Breathing animatesscale, a mood is arotatepose, a one-off istranslate. They are separate CSS properties, so they compose, and all of it stays on the compositor.src/launcher-pet.jsis a pure function from (query, rows, idle time) to a mood. It sees whether a row can be run, never its wording, which keeps the launcher's rule that nothing is decided by reading a title.prefers-reduced-motionand under the app's own setting. The pose stays; every animation and transition goes.Found in review, fixed before this was pushed
animation-durationon the doze rule outranked the hop and stretched it to six seconds. The breathing speed is now a variable.Limits
src/andsite/together. The lean stands in for eye tracking.Test plan
npm test: 520 pass, 0 fail, 4 skipped (POSIX only)npx eslint .clean